<style>
.normal{
display:none;
}
</style>
<script language="javascript">
     function validatefrom()
     {
        //var user_type=document.getElementById("user_type"); //$("#user_type");
        var user_email=$("#user_email");
        var user_passwd  =$("#user_passwd ");
        var confirm_user_passwd=$("#confirm_user_passwd");
        var secret_question =$("#secret_question ");
        var secret_answer =$("#secret_answer");
        var user_firstname =$("#user_firstname");
        var user_lastname =$("#user_lastname");

        var zip_code =$("#zip_code");
        var user_city = $("#user_city");
        //var Designation =$("#Designation");
        //var companyname =$("#companyname ");
        //var companyaddress=$("#companyaddress");
        var user_phone=$("#user_phone");
        //var user_fax =$("#user_fax");
        //var typeofbusiness =$("#typeofbusiness");
       // var industry=$("#industry");
        //var prefferedpayment =$("#prefferedpayment ");
        //var Status = document.getElementById("cmbStatus");
        //var profession =$("#profession");
        //var nicno =$("#nicno");
        var user_address =$("#user_address");
      var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;

	/*if(user_type.value == "")
	{
		alert("User Type cannot  be blank");
                user_type.focus();
		return false;
	}else */
        if(user_email.val() == "")
	{
		alert("Email cannot be blank");
                user_email.focus();
		return false;
        } else if(reg.test(user_email.val())==false)
	{
                alert("Invalid Email");
                user_email.focus();
		return false;
	} else if(user_passwd.val() == "") {
		alert("Password cannot be blank");
		user_passwd.focus();
		return false;
	}  else if(user_passwd.val() == "") {
		alert("Email cannot be blank");
		user_passwd.focus();
		return false;
	} else if(passvalidator(user_passwd.val())==false) {
		alert("password must be at least six characters long;");
		user_passwd.focus();
		return false;
	} 
        else if(user_passwd.val() != confirm_user_passwd.val())
        {
		alert("Passwor confirmaton failed");
		user_passwd.focus();
		return false;
	}  else if(secret_question.val() == "") {
		alert("Secret Question cannot be blank");
		secret_question.focus();
		return false;
	}  else if(secret_answer.val() == "") {
		alert("Secret Answer cannot be blank");
		secret_answer.focus();
		return false;
	}  else if(user_firstname.val() == "") {
		alert("First Name cannot be blank");
		user_firstname.focus();
		return false;
	} else if(user_lastname.val() == "") {
		alert("last Name cannot be blank");
		user_lastname.focus();
		return false;
	}
        else if(zip_code.val() == "")
        {
		alert("Zip Code cannot be blank");
		zip_code.focus();
		return false;

	}
        else if(user_city.val()== "" )
        {
            alert("City cannot be blank");
            user_city.focus();
            return false;
        } else
             if(user_address.val()=="") {
                    alert("User Address is required and cannot be blank");
                    user_address.focus();
                    return false;

            } 
            else if(user_phone.val() == "")
            {
                            alert("Phone cannot be blank");
                            user_phone.focus();
                            return false;
             }
        
        
            
}

function passvalidator(password )
{
    
    var passed = validatePassword(password, {
	length:   [6, Infinity] 
});
return passed;
}


</script>
<h2>Register Now</h2>
<div class="userimpforms">
	<form name="registerform" action="<?php echo SITEURL; ?>index.php?doregister" method="post" onsubmit="return validatefrom();" >
		
                 <dir class="field input clearfix">
                        <div class="klbl">User Name : </div>
			<div class="elmnt"><input type="text" name="user_name" id="user_name" value="" class="inp-form" size="40" /></div>
                 </dir>
		<div class="field input clearfix">
			<div class="klbl">First Name : </div>
			<div class="elmnt"><input type="text" name="user_firstname" id="user_firstname" value="" class="inp-form" size="40" /></div>
		</div>
		<div class="field input clearfix">
			<div class="klbl">Last Name : </div>
			<div class="elmnt"><input type="text" name="user_lastname" id="user_lastname" value="" class="inp-form" size="40" /></div>
		</div>
                <div class="field input clearfix">
			<div class="klbl">City : </div>
			<div class="elmnt"><input type="text" name="user_city" id="user_city" value="" class="inp-form" size="60" /></div>
		</div>

            <div class="field input clearfix">
			<div class="klbl">Zip Code : </div>
			<div class="elmnt"><input type="text" name="zip_code" id="zip_code" value="" class="inp-form" size="60" /></div>
		</div>

		<div class="field input clearfix">
			<div class="klbl">Contact Address : </div>
			<div class="elmnt"><input type="text" name="user_address" id="user_address" value="" class="inp-form" size="60" /></div>
		</div>
		<div class="field input clearfix">
			<div class="klbl">Tel No : </div>
			<div class="elmnt"><input type="text" name="user_phone" id="user_phone" value="" class="inp-form" /></div>
		</div>
		
		<div class="field input clearfix">
			<div class="klbl">E-Mail : </div>
			<div class="elmnt"><input type="text" name="user_email" id="user_email" value="" class="inp-form" size="60" /></div>
		</div>
		<div class="field input clearfix">
			<div class="klbl">Password : (minimum 6 characters)</div>
			<div class="elmnt"><input onkeyup="passwordStrength(this.value)" type="password" name="user_passwd" id="user_passwd" value="" class="inp-form" />
                        &nbsp;<div id="passwordDescription"></div><div id="passwordStrength" class="strength0"></div>
                        </div>

		</div>
		<div class="field input clearfix">
			<div class="klbl">Confirm Password : </div>
			<div class="elmnt"><input type="password" name="confirm_user_passwd" id="confirm_user_passwd" value="" class="inp-form" /></div>
		
                </div>
		<div class="field select clearfix">
			<div class="klbl">Security Question : </div>
			<div class="elmnt">
                         <select id="secret_question" name="secret_question" >
								<option value="">Select your secret question...</option>
								<option value="What street did you grow up on?">What street did you grow up on?</option>
								<option value="What is your mother's maiden name?">What is your mother's maiden name?</option>
								<option value="What is the name of your first school?">What is the name of your first school?</option>
								<option value="What is your pet's name?">What is your pet's name?</option>
								<option value="What is your father's middle name?">What is your father's middle name?</option>
								<option value="What is your school's mascot?">What is your school's mascot?</option>
                         </select>
                           </div>
		</div>
		<div class="field input clearfix">
			<div class="klbl">Security Answer : </div>
			<div class="elmnt"><input type="text" name="secret_answer" id="secret_answer" value="" class="inp-form" size="60" /></div>
		</div>		
		
		<div class="field submit clearfix">
			<div class="klbl"></div>
			<div class="elmnt"><input type="submit" value="Register" /></div>
		</div>
            <div>
                <a tabindex="-1" style="border-style: none" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = 'securimage_show.php?sid=' + Math.random(); return false"><img src="images/refresh.gif" alt="Reload Image" border="0" onclick="this.blur()" align="bottom" /></a> <br class="clear" />
            <div class="block">
              <input type="text" name="image_code" id="image_code" value="Please type in the above code here" class="captcha" />
            </div>
                </div>
	</form>
</div>
<script language="javascript">
$(document).ready(function () {
       $('#user_type').change(function() {
        if ($(this).val() == "2") {
            $(".business").show();
             $(".normal").hide();
        }
        else{
            $(".business").hide();
            $(".normal").show();
        }
       });
});
</script>
